<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 1000px;
            height: 100px;
            color: red;
            margin: 0 auto;
            text-align: center;
        }
    </style>
</head>
<body>
    <section>
        <div id="div1"></div>
    </section>
    <script src="js/date.js"></script>
    <script>
        var date1=new Date("2020/11/11")
        var date3=new Date()
        var x= chatime(date1,date3,"styles2")
        div1.innerHTML=x
        console.log(date1)
        var timer=setInterval(function(){
            var date2=new Date()
           var s= chatime(date1,date2,"styles2")
           div1.innerHTML=s
        },1000)
    </script>
</body>
</html>